package com.skydonkey.service.impl;

import com.skydonkey.dao.VideoSamplesFailedMapper;
import com.skydonkey.dao.VideoSamplesMapper;
import com.skydonkey.pojo.po.VideoSamplesFailed;
import com.skydonkey.pojo.po.VideoSamples;
import com.skydonkey.service.VideoSampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class VideoSampleServiceImpl implements VideoSampleService {

    @Autowired
    VideoSamplesMapper videoSamplesMapper;

    @Autowired
    VideoSamplesFailedMapper videoSamplesFailedMapper;


    @Override
    public int delete(String videoKey) {
        return 0;
    }

    public void addVideoSamples(List<VideoSamples> samples){
        for (VideoSamples sample : samples) {
            videoSamplesMapper.addSamples(sample);
        }
    }


    public List<VideoSamples> getVideoSamples(String videoKey){
        return videoSamplesMapper.getSamples(videoKey);
    }


    public List<VideoSamplesFailed> getVideoFailed(Long videoId){
        return videoSamplesFailedMapper.getFailed(videoId);
    }

    public int addVideoFailed(VideoSamplesFailed videoSamplesFailed){
        return videoSamplesFailedMapper.insertFailed(videoSamplesFailed);
    }




}
